<!-- 组件 -->
<script setup lang="ts">
	import axios from 'axios';

	let list = ref()

	let imageUrl = ref()

	const getDate = async () => {
		const res = await axios.get('https://jsonplaceholder.typicode.com/todos');
		list.value = res.data
	};

	const getCatData = async () => {
		const res = await axios.get('https://api.thecatapi.com/v1/images/search?limit=1')
		console.log(res.data[0].url)
		imageUrl.value = res.data[0].url
	}

	getDate();
	getCatData();
</script>

<template>
	<div v-for="item in list">
		<div class="flex mb-2">
			<image style="width: 48px; height: 48px;" mode="center" :src="imageUrl" />
			<div class="flex-1 ml-2">
				{{item.title}}
			</div>
		</div>
	</div>
</template>